package com.itcast.mallapplet.mapper;

import com.github.pagehelper.Page;
import com.itcast.admin.vo.DityVO;
import com.itcast.applet.dto.DityPageRequest;
import com.itcast.applet.entity.Commodity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommodityMapper {

    //分页加模糊查询加选择查询
    Page<Commodity>  dityQuerylist(DityPageRequest dityPageRequest);

    //根据商品id拿到所有数据
    List<DityVO> getDityUrl(List<Long> ids);

    //根据id查询单个商品
    Commodity getById(Long id);

    //根据商品id查询商品
    @Select("select * from commodity where id = #{id}")
    Commodity getByCommodityId(Long id);
}
